using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using RevitCopilot.MCPServer.Services;

Console.WriteLine("Starting MCP Server...");
var builder = Host.CreateEmptyApplicationBuilder(settings: null);

// 注册服务
// builder.Services.AddSingleton<RevitClientManager>(sp => RevitClientManager.Instance);
builder.Services.AddTransient<SocketService>();

// 配置MCP服务器
builder.Services
    .AddMcpServer()
    .WithStdioServerTransport()
    .WithToolsFromAssembly();

Console.WriteLine("MCP Server is ready to accept connections.");
await builder.Build().RunAsync();